package steed.util.redis;

public class JedisFactory {
	/*public static JedisPool pool;
	
	private static ThreadLocal<JedisCommands> threadLocal = new ThreadLocal<>();
	
	static{
		pool = praseConfig();
	}
	
	public static void release(){
		pool.destroy();
		threadLocal.remove();
		
		
		
	}
	
	private static JedisPool praseConfig(){
		//TODO 支持jedis集群模式
		JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
		return new JedisPool(jedisPoolConfig, PropertyUtil.getConfig("redis.host"), PropertyUtil.getInteger("redis.port"), PropertyUtil.getInteger("redis.timeOut"), AESUtil.aesDecode(PropertyUtil.getConfig("redis.password")));
	}
	
	public static JedisCommands getJedis(){
		if (threadLocal.get() == null) {
			threadLocal.set(pool.getResource());
		}
		return threadLocal.get();
	}*/
}
